<#setting classic_compatible=true> 
<#assign base=request.contextPath /> <!DOCTYPE html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>统一消息中心</title>
<link rel="icon" href="${base}/zhgl-jzstyxx-manage/images/favicon.ico" type="image/ico" />
<link rel="stylesheet" type="text/css" href="${base}/zhgl-jzstyxx-manage/css/bootstrap-table.min.css">
<!-- 引入通用css -->
<#include "/common/commoncss.ftl">
<link rel="stylesheet" type="text/css" href="${base}/zhgl-jzstyxx-manage/css/basicManagement/template.css">
<link rel="stylesheet" type="text/css" href="${base}/zhgl-jzstyxx-manage/css/model.css">
</head>

<body class="nav-md">

<!--弹出模态框-->


<!-- 新增/修改框 -->
<div class="modal fade in" id="addOrEditModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop='static' padding-right: 17px;">
    <div class="modal-dialog" style="width:600px !important;margin-top: 40px;margin-bottom: 40px" role="document">

	    <div class="modal-content">
	      <!-- 标题 -->
	      <div class="modal-header">
	        <button class="close" type='button' data-dismiss='modal' aria-hidden='true'>&times;</button>
	        <h4 class="modal-title" id="myModalLabel"></h4>
	      </div>
	      
	      <!-- 内容 -->
	      <div class="modal-body">
              <form  id="addOrEdit" class="form-horizontal">
                  <input type="hidden" name="id" id="cId"/>
                  <div class="form-group">
                      <label for="templatename" class="col-sm-2 control-label mylabel">模板名称</label>
                      <div class="col-sm-4 col-sm-me">
                          <input type="text" class="form-control" name="templatename" id="templatename" placeholder="请输入模板名称" onkeyup="this.value=this.value.replace(/^ +|$/g, '')" maxlength="32">
                      </div>
                  </div>
                  <div class="form-group">
                      <label for="templateContent" class="col-sm-2 control-label mylabel">模板内容</label>
                      <div class="col-sm-4 col-sm-me">
                          <textarea  class="form-control" id="templateContent"  name="templateContent" placeholder='内容格式:您好{{name}}先生,您今年{{age}}岁' onkeyup="this.value=this.value.replace(/^ +|$/g, '')"onkeyup="this.value=this.value.replace(/^ +| +$/g, '')" maxlength="2000" onchange="templateContentChange()"></textarea>
                      </div>
                  </div>
                  <div class="form-group">
                      <label for="sampleData" class="col-sm-2 control-label mylabel">数据示例</label>
                      <div class="col-sm-4 col-sm-me" >
                      	<textarea  class="form-control" id="sampleData" name="sampleData" placeholder='数据格式:{"name":"某某","age":25}' onkeyup="this.value=this.value.replace(/^ +|$/g, '')" maxlength="2000" onchange="sampleDataChange()"></textarea>
                      	 <div style="text-align: left;"> 
                      		<input class="btn btn-primary" type="button"  value="数据模板匹配" id="btn_match" style="margin-top: 10px;margin-bottom: 2px;float: left"onclick="match()">
                      	 </div> 
                      </div>                   			  
                  </div>
                  
                  <div class="form-group">
                      <label for="templateSample" class="col-sm-2 control-label mylabel">模板样例</label>
                      <div class="col-sm-4 col-sm-me">
                          <textarea class="form-control" id="templateSample" readonly="readonly"></textarea>
                      </div>
                  </div>
              </form>
	      </div>
	      
	      <!-- 尾部 -->
	      <div class="modal-footer">
	      	<div class="footer-button">
	      		<button  id="submit" class="btn btn-primary save" onclick="saveAddOrEdit()">提交</button>
	        	<button  id="exit" class="btn btn-primary back"  data-dismiss='modal'>关闭</button>   
	        </div>  
	      </div>
	      
	    </div>
	</div>
</div>


			<div style="margin-top: 10px;margin-bottom: 10px">
				<p style="margin-bottom: 0px"><i class="fa fa-table" style="margin-right: 20px"></i>基础数据&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;模板管理</p>
			</div>
				<div class="container body-content">
					<div class="panel panel-default" style="margin-bottom: 10px">
						<div class="panel-body" >
							<form class="form-inline">
								<div class="row" style="margin: auto">
									<div class="col-sm-4" style="margin-top: 5px;width:100%;">
										<label for='name' class='control-lable'>模板名称</label>
										<input id="templateName" type="text" class="form-control inputbox" placeholder="请输入模板名称" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" 
			                                  onpaste="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" 
			                                  oncontextmenu = "value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" maxlength="32">
										<button id="btn_query" type="button" class="btn btn-default">
							 				<span class="fa fa-search" aria-hidden="true"></span>&nbsp;查询
										</button>
									</div>
								</div>
							</form>
							
					<div id="tool" class="btn-group">
					<#if param?? && param == "unprocessedApp">
		                <button	type="button" class="btn btn-default two-word-btn" onclick="saveTemplate()" style="background: #3B9ED9; color: #fff;">
		                    	<span class="iconfont icon-baocun btn-icon"></span>&nbsp;保存
			            </button>
		                <button	type="button" class="btn btn-default two-word-btn" onclick="cancel()" style="background: #32984A; color: #fff;">
		                    	<span class="iconfont icon-chehui btn-icon"></span>&nbsp;取消
			            </button> 
			       <#else>
						<button id="btn_add" type="button" class="btn btn-default" onclick="AddTemplate()" style="background-color: #3B9ED9">
							 <span class="iconfont icon-add" aria-hidden="true"></span>&nbsp;新增
						</button>
						<button id="btn_edit" type="button" class="btn btn-default" onclick="editById()" style="background-color: #7ABD3E">
							 <span class="iconfont icon-edit-1-copy" aria-hidden="true"></span>&nbsp;修改
						</button>
						<button id="btn_delete" type="button" class="btn btn-default" onclick="deleteByIds()" style="background-color: #FFA45A">
							 <span class="iconfont icon-shanchu" aria-hidden="true"></span>&nbsp;删除
						</button>	
					</#if>					
					</div>
							<table id="tb_template" style="table-layout:fixed;"></table>
					</div>
					
				</div>
			
			</div>

	<!-- 引入通用和js -->
	<#include "/common/commonjs.ftl"> 
<script type="text/javascript" src="${base}/zhgl-jzstyxx-manage/js/jquery.serializejson.min.js"></script>
<script type="text/javascript" src="${base}/zhgl-jzstyxx-manage/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="${base}/zhgl-jzstyxx-manage/js/basicManagement/template.js"></script> 
<!-- <script src="${base}/zhgl-jzstyxx-manage/js/cookie/jquery.cookie.js"></script> -->
<script type="text/javascript">
var param = "${param}";
var key = "${key}";
</script>
</body>
</html>